def concat3(t, s):
result = ''
for i in range(t):
result += s
return result
Function Call | Return Value | |||
---|---|---|---|---|
concat3(3, 'Car') | → | |||
concat3(1, 'Hello') | → | |||
concat3(9, '5') | → | |||
concat3(5, 'ree') | → | |||
concat3(3, 'Hi') | → | |||
concat3(4, 'bat') | → | |||
concat3(5, '') | → | |||
concat3(4, ' ') | → | |||
concat3(0, 'abc') | → |
Experiment with this code on Gitpod.io